<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="jenkins,docker,mesos,dcos,marathon,Nginx,Gitbook,Gitlab," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="使用Gitbook Editor编写Markdown文档非常方便，而且Gitbook Editor可以直接加载Git仓库，文档的修改可以立即提交。
编写的Markdown文档可以通过gitbook build命令直接编译为静态页面，然后通过Nginx托管。
本文通过下述流程将整个编写及发布的过程自动化起来并最终部署到DC/OS集群中：
Gitbook Editor —&amp;gt; Gitlab —&amp;g">
<meta property="og:type" content="article">
<meta property="og:title" content="在DC/OS集群中自动发布Gitbook">
<meta property="og:url" content="http://chrisrc.me/2017/01/18/gitbook-publish-on-dcos/index.html">
<meta property="og:site_name" content="山中，山外与俯瞰">
<meta property="og:description" content="使用Gitbook Editor编写Markdown文档非常方便，而且Gitbook Editor可以直接加载Git仓库，文档的修改可以立即提交。
编写的Markdown文档可以通过gitbook build命令直接编译为静态页面，然后通过Nginx托管。
本文通过下述流程将整个编写及发布的过程自动化起来并最终部署到DC/OS集群中：
Gitbook Editor —&amp;gt; Gitlab —&amp;g">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_editor.png">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_editor_detail.png">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_jenkins_slave.png">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_jenkins_job_build.png">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_job_deploy.png">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_job_trigger.png">
<meta property="og:image" content="http://chrisrc.me/images/dcos_gitbook_gitlab_webhooks.png">
<meta property="og:updated_time" content="2017-01-18T14:43:43.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="在DC/OS集群中自动发布Gitbook">
<meta name="twitter:description" content="使用Gitbook Editor编写Markdown文档非常方便，而且Gitbook Editor可以直接加载Git仓库，文档的修改可以立即提交。
编写的Markdown文档可以通过gitbook build命令直接编译为静态页面，然后通过Nginx托管。
本文通过下述流程将整个编写及发布的过程自动化起来并最终部署到DC/OS集群中：
Gitbook Editor —&amp;gt; Gitlab —&amp;g">
<meta name="twitter:image" content="http://chrisrc.me/images/dcos_gitbook_editor.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://chrisrc.me/2017/01/18/gitbook-publish-on-dcos/"/>





  <title> 在DC/OS集群中自动发布Gitbook | 山中，山外与俯瞰 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">山中，山外与俯瞰</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">一次永不停止的探索之旅</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-dcos">
          <a href="/dcos" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            DC/OS
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'R9GcmhBwxpsAGLNCsquZ','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://chrisrc.me/2017/01/18/gitbook-publish-on-dcos/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="chrisrc">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="山中，山外与俯瞰">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="山中，山外与俯瞰" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                在DC/OS集群中自动发布Gitbook
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2017-01-18T18:28:18+08:00">
                2017-01-18
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/DC-OS/" itemprop="url" rel="index">
                    <span itemprop="name">DC/OS</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <a href="/2017/01/18/gitbook-publish-on-dcos/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2017/01/18/gitbook-publish-on-dcos/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>使用Gitbook Editor编写Markdown文档非常方便，而且Gitbook Editor可以直接加载Git仓库，文档的修改可以立即提交。</p>
<p>编写的Markdown文档可以通过<code>gitbook build</code>命令直接编译为静态页面，然后通过Nginx托管。</p>
<p>本文通过下述流程将整个编写及发布的过程自动化起来并最终部署到DC/OS集群中：</p>
<p><strong><br>Gitbook Editor —&gt; Gitlab —&gt; Jenkins —&gt; Docker(Nginx Image) —&gt; DC/OS
</strong></p>
<a id="more"></a>
<h3 id="Gitbook-Editor"><a href="#Gitbook-Editor" class="headerlink" title="Gitbook Editor"></a>Gitbook Editor</h3><p>可以从Gitbook <a href="https://www.gitbook.com/editor" target="_blank" rel="external">Editor官网</a>下载编辑器，支持Mac，Linux和Windows环境。</p>
<p><img src="/images/dcos_gitbook_editor.png" alt=""></p>
<p>可以在Gitbook Editor中创建新的书籍，打开或导入已有书籍。</p>
<h3 id="Gitlab"><a href="#Gitlab" class="headerlink" title="Gitlab"></a>Gitlab</h3><p>通过Gitlab可以将书籍编辑的源文件进行版本跟踪。已跟踪的Git仓库可以直接在Gitbook Editor中打开或导入。</p>
<p>如上述示例中，导入了托管在Github的<strong><a href="https://github.com/christtrc/dcos" target="_blank" rel="external">dcos</a></strong>和内部Gitlab服务器上的<strong>docs-dev</strong>。</p>
<p><img src="/images/dcos_gitbook_editor_detail.png" alt=""></p>
<p>在文档Git仓库中添加一个Dockerfile文件，内容如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">FROM nginx:1.11.8-alpine</div><div class="line">COPY _book/* /usr/share/nginx/html</div></pre></td></tr></table></figure>
<p>后续可以看到如何在文档变更时触发Jenkins的任务自动编译和发布Gitbook文档。</p>
<h3 id="Jenkins"><a href="#Jenkins" class="headerlink" title="Jenkins"></a>Jenkins</h3><p>Jenkins在DC/OS中采用DnD方案执行Job，默认的jenkins slave镜像不支持Gitbook环境，需要在<code>mesosphere/jenkins-dind</code>基础上构建一下gitbook编译环境。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div></pre></td><td class="code"><pre><div class="line">FROM mesosphere/jenkins-dind:0.4.0-ubuntu</div><div class="line"></div><div class="line">ENV SSH_KNOWN_HOSTS 192.168.1.54</div><div class="line">RUN ssh-keyscan $SSH_KNOWN_HOSTS | tee /etc/ssh/ssh_known_hosts</div><div class="line"></div><div class="line"># gpg keys listed at https://github.com/nodejs/node</div><div class="line">RUN set -ex \</div><div class="line">    &amp;&amp; for key in \</div><div class="line">    9554F04D7259F04124DE6B476D5A82AC7E37093B \</div><div class="line">    94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \</div><div class="line">    0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93 \</div><div class="line">    FD3A5288F042B6850C66B31F09FE44734EB7990E \</div><div class="line">    71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \</div><div class="line">    DD8F2338BAE7501E3DD5AC78C273792F7D83545D \</div><div class="line">    B9AE9905FFD7803F25714661B63B535A4C206CA9 \</div><div class="line">    C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \</div><div class="line">    ; do \</div><div class="line">    gpg --keyserver ha.pool.sks-keyservers.net --recv-keys &quot;$key&quot;; \</div><div class="line">    done</div><div class="line"></div><div class="line">ENV NPM_CONFIG_LOGLEVEL info</div><div class="line">ENV NODE_VERSION 6.9.4</div><div class="line">ARG GITBOOK_VERSION=3.2.0</div><div class="line"></div><div class="line">RUN buildDeps=&apos;xz-utils&apos; \</div><div class="line">    &amp;&amp; set -x \</div><div class="line">    &amp;&amp; apt-get update &amp;&amp; apt-get install -y $buildDeps --no-install-recommends \</div><div class="line">    &amp;&amp; rm -rf /var/lib/apt/lists/* \</div><div class="line">    &amp;&amp; curl -SLO &quot;https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz&quot; \</div><div class="line">    &amp;&amp; curl -SLO &quot;https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc&quot; \</div><div class="line">    &amp;&amp; gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \</div><div class="line">    &amp;&amp; grep &quot; node-v$NODE_VERSION-linux-x64.tar.xz\$&quot; SHASUMS256.txt | sha256sum -c - \</div><div class="line">    &amp;&amp; tar -xJf &quot;node-v$NODE_VERSION-linux-x64.tar.xz&quot; -C /usr/local --strip-components=1 \</div><div class="line">    &amp;&amp; rm &quot;node-v$NODE_VERSION-linux-x64.tar.xz&quot; SHASUMS256.txt.asc SHASUMS256.txt \</div><div class="line">    &amp;&amp; apt-get purge -y --auto-remove $buildDeps \</div><div class="line">    &amp;&amp; ln -s /usr/local/bin/node /usr/local/bin/nodejs</div><div class="line"></div><div class="line"></div><div class="line">RUN npm --registry=https://registry.npm.taobao.org install --global gitbook-cli &amp;&amp;\</div><div class="line">    gitbook fetch $&#123;GITBOOK_VERSION&#125; &amp;&amp;\</div><div class="line">    npm cache clear &amp;&amp;\</div><div class="line">    rm -rf /tmp/*</div></pre></td></tr></table></figure>
<p>镜像构建并编译完成后可以发布到Docker Hub仓库或<a href="/dcos/dcos-service-pre-private-docker-registry.html">本地私有仓库</a>。</p>
<p>配置DC/OS中的<a href="/dcos/dcos-service-jenkins.html">Jenkins</a>，添加新的Jenkins Slave镜像并设置标签为“<code>gitbook</code>”。</p>
<p><img src="/images/dcos_gitbook_jenkins_slave.png" alt=""></p>
<h3 id="Docker-Image"><a href="#Docker-Image" class="headerlink" title="Docker Image"></a>Docker Image</h3><p>编译Gitbook的Jenkins Slave镜像准备就绪后，在Jenkins中创建一个自由风格的Job，命名为：“docs_dev_gitbook_publish”。</p>
<p>在这个Job任务中下载文档仓库，调用gitbook-cli编译，打包Docker镜像，并发布到DC/OS。具体配置如下：</p>
<p>Gitbook编译和打包镜像<br><img src="/images/dcos_gitbook_jenkins_job_build.png" alt=""></p>
<p>发布到DC/OS:</p>
<p><img src="/images/dcos_gitbook_job_deploy.png" alt=""></p>
<p>具体脚本参考下文。</p>
<h3 id="DC-OS部署"><a href="#DC-OS部署" class="headerlink" title="DC/OS部署"></a>DC/OS部署</h3><p>托管Gitbook的Nginx应用Marathon程序定义如下：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div></pre></td><td class="code"><pre><div class="line">curl -i -H &quot;Content-type: application/json&quot; -X PUT http://192.168.1.69:8080/v2/apps/docs-dev-gitbook -d &apos;</div><div class="line">&#123;</div><div class="line">    &quot;id&quot;: &quot;docs-dev-gitbook&quot;,</div><div class="line">    &quot;cpus&quot;: 0.2,</div><div class="line">    &quot;mem&quot;: 512,</div><div class="line">    &quot;disk&quot;: 0,</div><div class="line">    &quot;instances&quot;: 1,</div><div class="line">    &quot;container&quot;: &#123;</div><div class="line">        &quot;docker&quot;: &#123;</div><div class="line">            &quot;image&quot;: &quot;192.168.0.1/docs/docs_dev_gitbook_nginx:latest&quot;,</div><div class="line">            &quot;forcePullImage&quot;: true,</div><div class="line">            &quot;privileged&quot;: false,</div><div class="line">            &quot;portMappings&quot;: [</div><div class="line">                &#123;</div><div class="line">                &quot;containerPort&quot;: 80,</div><div class="line">                &quot;servicePort&quot;: 11111,</div><div class="line">                &quot;protocol&quot;: &quot;tcp&quot;,</div><div class="line">                &quot;labels&quot;: &#123;</div><div class="line">                    &quot;VIP_0&quot;: &quot;docs_dev_gitbook_nginx:11111&quot;</div><div class="line">                &#125;</div><div class="line">                &#125;</div><div class="line">            ],</div><div class="line">            &quot;network&quot;: &quot;BRIDGE&quot;</div><div class="line">        &#125;,</div><div class="line">        &quot;type&quot;: &quot;DOCKER&quot;</div><div class="line">    &#125;,</div><div class="line">    &quot;labels&quot;: &#123; &quot;HAPROXY_GROUP&quot;: &quot;external&quot;, &quot;DOCS_DEV_GITBOOK_BUILD_ID&quot;: &quot;&apos;&quot;$BUILD_ID&quot;&apos;&quot; &#125;,</div><div class="line">    &quot;healthChecks&quot;: [</div><div class="line">        &#123;</div><div class="line">            &quot;protocol&quot;: &quot;HTTP&quot;,</div><div class="line">            &quot;path&quot;: &quot;/&quot;,</div><div class="line">            &quot;gracePeriodSeconds&quot;: 60,</div><div class="line">            &quot;intervalSeconds&quot;: 30,</div><div class="line">            &quot;timeoutSeconds&quot;: 60,</div><div class="line">            &quot;maxConsecutiveFailures&quot;: 3,</div><div class="line">            &quot;portIndex&quot;: 0,</div><div class="line">            &quot;ignoreHttp1xx&quot;: false</div><div class="line">        &#125;</div><div class="line">    ]</div><div class="line">&#125;</div><div class="line">&apos;</div></pre></td></tr></table></figure>
<h3 id="补充"><a href="#补充" class="headerlink" title="补充"></a>补充</h3><p>在Jenkins的Job任务中可以看到如下图所示用于触发该任务的URL，Gitlab可以在文档代码提交时通过该URL自动触发任务执行。<br><img src="/images/dcos_gitbook_job_trigger.png" alt=""></p>
<p>在Gitlab的文档代码仓库的<code>Webhooks</code>下添加如下配置：<br><img src="/images/dcos_gitbook_gitlab_webhooks.png" alt=""></p>
<p><strong>注意</strong>，在DC/OS中，这两处的URL地址稍有不同，推荐使用类似后面的地址，即使Jenkins重新部署，在DC/OS集群的Master节点未变化时，此URL地址不变。</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/jenkins/" rel="tag"># jenkins</a>
          
            <a href="/tags/docker/" rel="tag"># docker</a>
          
            <a href="/tags/mesos/" rel="tag"># mesos</a>
          
            <a href="/tags/dcos/" rel="tag"># dcos</a>
          
            <a href="/tags/marathon/" rel="tag"># marathon</a>
          
            <a href="/tags/Nginx/" rel="tag"># Nginx</a>
          
            <a href="/tags/Gitbook/" rel="tag"># Gitbook</a>
          
            <a href="/tags/Gitlab/" rel="tag"># Gitlab</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2016/12/18/legacy-app-on-dcos/" rel="next" title="遗留应用如何快速迁移到DC/OS">
                <i class="fa fa-chevron-left"></i> 遗留应用如何快速迁移到DC/OS
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/01/25/continuos-deploy-on-dcos/" rel="prev" title="在DC/OS集群中实现AB测试和灰度发布">
                在DC/OS集群中实现AB测试和灰度发布 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2017/01/18/gitbook-publish-on-dcos/"
     data-title="在DC/OS集群中自动发布Gitbook"
     data-content=""
     data-url="http://chrisrc.me/2017/01/18/gitbook-publish-on-dcos/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2017/01/18/gitbook-publish-on-dcos/"
           data-title="在DC/OS集群中自动发布Gitbook" data-url="http://chrisrc.me/2017/01/18/gitbook-publish-on-dcos/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="chrisrc" />
          <p class="site-author-name" itemprop="name">chrisrc</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">69</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">162</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/christtrc" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/chrisrc" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#Gitbook-Editor"><span class="nav-number">1.</span> <span class="nav-text">Gitbook Editor</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Gitlab"><span class="nav-number">2.</span> <span class="nav-text">Gitlab</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Jenkins"><span class="nav-number">3.</span> <span class="nav-text">Jenkins</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Docker-Image"><span class="nav-number">4.</span> <span class="nav-text">Docker Image</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#DC-OS部署"><span class="nav-number">5.</span> <span class="nav-text">DC/OS部署</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#补充"><span class="nav-number">6.</span> <span class="nav-text">补充</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">
     
      <a href="mailto:chrisrc@qq.com">chrisrc</a> 
    
  </span>
  <span class="author"> &nbsp; QQ: 58122705 </span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"chrisrc"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  








  
  

  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
<script>
(function(){
   var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04":"https://jspassport.ssl.qhimg.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04";
   document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>

  


</body>
</html>
